getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Thu, 5 Mar 2020 20:59:46 +0000 (20:59 +0000)
committerRyan Tandy <ryan@nardis.ca>
Thu, 5 Mar 2020 20:59:46 +0000 (20:59 +0000)
commit0deb7aef38483fe1740010185bc5ccc015d683b0
tree70ee4141a28b848dce66770b5c32e114944b0ce7
parent646f5473c61d8c9c3ce9e6c5b5cfcb1009b7eff8
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c